let arr = ['张三', '李四', '王五'];

let key = arr.keys();
let value = arr.values();
let entry = arr.entries();

console.log(key, value, entry);
// .next()方法
// console.log(key.next());
// console.log(key.next());
// console.log(key.next());
// console.log(key.next());

// 重构for of 循环
let result;
while (!(result = entry.next()).done) {
  console.log(result.value);
}


// for (let k of key) {
//   console.log(k);
// }
// for (let val of value) {
//   console.log(val);
// }
// for (let en of entry) {
//   console.log(en);
// }





// 遍历字符串
// let str = 'hello'
// for (let i of str) {
//   console.log(i);
// }
// 将字符串转成数组
// let arr1 = str.split('');
// let arr2 = Array.from(str);
// let [...arr3] = str;
// console.log('------', arr1, arr2, arr3);


// let [...a] = 'hello';
// console.log(a);